In the formation of integrated circuits, multiple layers of different materials are formed. These layers may be removed in subsequent processes, or may be left in the final structure. These layers often have undesirable stresses, which cause problems in the resulting devices. For example, the stress may cause the shift of the positions of some features, and may also cause the drift of electrical properties of some devices.